import { Ref, ref } from "vue";

export function useBoolean(
  init = false
): [Ref<boolean>, () => void, () => void, () => void] {
  const bool = ref(init);

  const setTrue = () => {
    bool.value = true;
  };
  const setFalse = () => {
    bool.value = false;
  };
  const trigger = () => {
    bool.value = !bool.value;
  };

  return [bool, setTrue, setFalse, trigger];
}
